<?php
/**
 * 管理员
 * Created by Vscode.
 * User: Luanzg
 * Date: 2020/05/22 1526
 * Time: 15:26
 */
namespace app\common\validate;

class Channel extends BaseValidate
{

    protected $field = [
        'channel_name'      => '频道名称',
        'master_play_term' => '主控制终端',          //*主播出站终端ID
        'slave_play_term' => '备控制终端',            //*备播出站终端ID
        'master_heartbeat_port' => '主播出站心跳检测端口',//*主心跳端口
        'slave_heartbeat_port' => '备播出站心跳检测端口',  //*备心跳端口
        'master_swt_id' => '主切换台',                //*主切换台ID
        'slave_swt_id' => '备切换台',                  //*备切换台ID
        'master_vdr_id' => '主视频服务器',                //*主视频服务器ID
        'slave_vdr_id' => '备视频服务器',                  //*备视频服务器ID
        'master_vdr_chan' => '主视频服务器播出通道',            //*主视频服务器通道
        'slave_vdr_chan' => '备视频服务器播出通道',              //*备视频服务器通道
        'keymix' => '外置键混',                              //*外置键混
        'cg' => '遥控字幕机',                                      //*控制字幕机
    ];

    protected $rule = [
        'channel_name'   => 'require',
        'master_play_term' => 'require',          //*主播出站终端ID
        'slave_play_term' => 'require',            //*备播出站终端ID
        'master_heartbeat_port' => 'require',//*主心跳端口
        'slave_heartbeat_port' => 'require',  //*备心跳端口
        'master_swt_id' => 'require',                //*主切换台ID
        'slave_swt_id' => 'require',                  //*备切换台ID
        'master_vdr_id' => 'require',                //*主视频服务器ID
        'slave_vdr_id' => 'require',                  //*备视频服务器ID
        'master_vdr_chan' => 'require',            //*主视频服务器通道
        'slave_vdr_chan' => 'require',              //*备视频服务器通道
        'keymix' => 'require',                              //*外置键混
        'cg' => 'require',                                      //*控制字幕机
    ];

    /**
     * 添加
     */
    protected function sceneaddedit()
    {
        return $this->only([
            'channel_name',
            'master_play_term',          //*主播出站终端ID
            'slave_play_term',            //*备播出站终端ID
            'master_heartbeat_port',//*主心跳端口
            'slave_heartbeat_port',  //*备心跳端口
            'master_swt_id',                //*主切换台ID
            'slave_swt_id',                  //*备切换台ID
            'master_vdr_id',                //*主视频服务器ID
            'slave_vdr_id',                  //*备视频服务器ID
            'master_vdr_chan',            //*主视频服务器通道
            'slave_vdr_chan',              //*备视频服务器通道
            'keymix',                              //*外置键混
            'cg',                                      //*控制字幕机
        ]);
    }

}
